package cn.bugstack.mybatis.executor.statement;

import cn.bugstack.mybatis.executor.resultset.ResultSetHandler;
import cn.bugstack.mybatis.mapping.BoundSql;
import cn.bugstack.mybatis.session.ResultHandler;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;

/**
 * @author wcc
 * @description 语句处理器
 * @create
 */

public interface StatementHandler {
    /** 准备语句 */
    Statement prepare(Connection connection) throws SQLException;
    /** 参数化 */
    void parameterize(Statement statement) throws SQLException;
    /** 执行查询 */
    <E>List<E> query(Statement statement, ResultHandler resultHandler) throws SQLException;
    /** 执行修改 */
    int update(Statement statement) throws SQLException;
}
